package com.csc.dataaccess.dao.impl;

// Generated Jul 16, 2014 5:03:21 PM by Hibernate Tools 4.0.0

import java.util.List;

import javax.naming.InitialContext;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
import org.hibernate.LockMode;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.criterion.Example;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.csc.dataaccess.dao.LjdeexttrtDao;
import com.csc.dataaccess.entity.Ljdeexttrt;

/**
 * Home object for domain model class Ljdeexttrt.
 * @see com.csc.dataaccess.dao.Ljdeexttrt
 * @author Hibernate Tools
 */
public class LjdeexttrtDaoImpl{
	
}

//public class LjdeexttrtDaoImpl implements LjdeexttrtDao {
//
//	private static final Log log = LogFactory.getLog(LjdeexttrtDaoImpl.class);
//
//	private final static SessionFactory sessionFactory = getSessionFactory();
//
//	protected static SessionFactory getSessionFactory() {
//		try {
////			return (SessionFactory) new InitialContext()
////					.lookup("SessionFactory");
//			return new Configuration().configure().buildSessionFactory();
//			
//		} catch (HibernateException ex){
//			log.error("HibernateException", ex);
//			ex.printStackTrace();
//			throw new IllegalStateException(
//					"Could not locate SessionFactory in JNDI");}
////		} catch (Exception e) {
////			log.error("Could not locate SessionFactory in JNDI", e);
////			throw new IllegalStateException(
////					"Could not locate SessionFactory in JNDI");
////		}
//	}
//	
//	public static SessionFactory getLjdSession(){
//		return sessionFactory;
//	}
//
//	public void persist(Ljdeexttrt transientInstance) {
//		log.debug("persisting Ljdeexttrt instance");
//		try {
//			sessionFactory.getCurrentSession().persist(transientInstance);
//			log.debug("persist successful");
//		} catch (RuntimeException re) {
//			log.error("persist failed", re);
//			throw re;
//		}
//	}
//
//	public void attachDirty(Ljdeexttrt instance) {
//		log.debug("attaching dirty Ljdeexttrt instance");
//		try {
//			sessionFactory.getCurrentSession().saveOrUpdate(instance);
//			log.debug("attach successful");
//		} catch (RuntimeException re) {
//			log.error("attach failed", re);
//			throw re;
//		}
//	}
//
//	public void attachClean(Ljdeexttrt instance) {
//		log.debug("attaching clean Ljdeexttrt instance");
//		try {
//			sessionFactory.getCurrentSession().lock(instance, LockMode.NONE);
//			log.debug("attach successful");
//		} catch (RuntimeException re) {
//			log.error("attach failed", re);
//			throw re;
//		}
//	}
//
//	public void delete(Ljdeexttrt persistentInstance) {
//		log.debug("deleting Ljdeexttrt instance");
//		try {
//			sessionFactory.getCurrentSession().delete(persistentInstance);
//			log.debug("delete successful");
//		} catch (RuntimeException re) {
//			log.error("delete failed", re);
//			throw re;
//		}
//	}
//
//	public Ljdeexttrt merge(Ljdeexttrt detachedInstance) {
//		log.debug("merging Ljdeexttrt instance");
//		try {
//			Ljdeexttrt result = (Ljdeexttrt) sessionFactory.getCurrentSession()
//					.merge(detachedInstance);
//			log.debug("merge successful");
//			return result;
//		} catch (RuntimeException re) {
//			log.error("merge failed", re);
//			throw re;
//		}
//	}
//
//	public Ljdeexttrt findById(long id) {
//		log.debug("getting Ljdeexttrt instance with id: " + id);
//		try {
//			Ljdeexttrt instance = (Ljdeexttrt) sessionFactory
//					.getCurrentSession().get(
//							"com.csc.dataaccess.dao.Ljdeexttrt", id);
//			if (instance == null) {
//				log.debug("get successful, no instance found");
//			} else {
//				log.debug("get successful, instance found");
//			}
//			return instance;
//		} catch (RuntimeException re) {
//			log.error("get failed", re);
//			throw re;
//		}
//	}
//
//	public List<Ljdeexttrt> findByExample(Ljdeexttrt instance) {
//		log.debug("finding Ljdeexttrt instance by example");
//		try {
//			List<Ljdeexttrt> results = sessionFactory.getCurrentSession()
//					.createCriteria("com.csc.dataaccess.dao.Ljdeexttrt")
//					.add(Example.create(instance)).list();
//			log.debug("find by example successful, result size: "
//					+ results.size());
//			return results;
//		} catch (RuntimeException re) {
//			log.error("find by example failed", re);
//			throw re;
//		}
//	}
//}
